<?php // $this->load->view('layouts/_flash');
//var_dump($total_rows);
?>

<style>
.calendar {
    font-family: Arial, Verdana, Sans-serif;
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}

.calendar tbody tr:first-child th {
    color: #505050;
    margin: 0 0 10px 0;
}

.day_header {
    font-weight: normal;
    text-align: center;
    color: #757575;
    font-size: 10px;
}

.calendar td {
    width: 14%; /* Force all cells to be about the same width regardless of content */
    border:1px solid #CCC;
    height: 100px;
    vertical-align: top;
    font-size: 10px;
    padding: 0;
}

.calendar td:hover {
    background: #F3F3F3;
}

.day_listing {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #2C2C2C;
    padding: 5px 5px 0 0;
}

.with_content{
    display: block;
    text-align: right;
    font-size: 12px;
    color: #2C2C2C;
    padding: 5px 5px 0 0;
	background: #99ccff;
    height: 100%;
}

.today_with_content{
    display: block;
    text-align: right;
    font-size: 12px;
    color: #2C2C2C;
    padding: 5px 5px 0 0;
	background: #00ff99;
    height: 100%;
}

div.today {
    background: #E9EFF7;
    height: 100%;
}  
</style>
<div style="float: left;">

<div class="ui-corner-top side_menu" style="width: 800px;">News And Events</div>
<div style="border:1px  solid #286bcc;">
	<div>&nbsp;</div>
	<div>
	<?if(isset($system_message))echo $system_message;?>
	
	<?php
	if($this->uri->segment(3) === '' || $this->uri->segment(3) === FALSE)
	{
	$year = date( 'Y' );
	}
	else
	{
	$year = $this->uri->segment(3);
	}
	
	if($this->uri->segment(4) === '' || $this->uri->segment(4) === FALSE)
	{
	$month = date( 'm' );
	}
	else
	{
	$month = $this->uri->segment(4);
	}
	$data = array();
	$data1 = array();
	foreach($date as $d):
		$data1 = array();
		$dater = explode("-",$d->announcement_date);
		if($dater[0] === $year && $dater[1] === $month)
		{	
			$data1 = array(
				$dater[2]  => 'shownewsandevents/'.$dater[0].'/'.$dater[1].'/'.$dater[2]
			);
		}
		$data = $data + $data1;
	endforeach;
	//print_r($data);
	//$data = array(
               //3  => 'http://example.com/news/article/2006/03/',
               //7  => 'http://example.com/news/article/2006/07/',
               //13 => 'http://example.com/news/article/2006/13/',
               //26 => 'http://example.com/news/article/2006/26/'
        //);
		
	echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $data);
	?>
	
	</div>
	<div class="input-block"><a href="<?=site_url('finance/createnewsandevents');?>" class="add">New News And Events</a></div>
	<div class="clearfloat"></div>
</div>

<div>&nbsp;</div>
</div>